﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using IBupro.Models.Classes;
using System.Web.Mvc;
using iBuproModel.Repositories.Interfaces;

namespace IBupro.Models
{
    public class DiplomProjectLectorModel : CustomModel
    {
        [Required(ErrorMessage="*")]
        public string Name { get; set; }

        [Required(ErrorMessage = "*")]
        public string Detail { get; set; }

        [Required(ErrorMessage = "*")]
        public string Shortcut { get; set; }

        [Required(ErrorMessage = "*")]
        public int SubjectId { get; set; }

        [Required(ErrorMessage = "*")]
        public int ProjectTypeId { get; set; }

        [Required(ErrorMessage = "*")]
        public string Tags { get; set; }

        [Required(ErrorMessage = "*")]
        public int DepartmentId { get; set; }

        public string Literature { get; set; }



        /// <summary>
        /// Project cannot be edited in come cases
        /// (for example project in booked state)
        /// </summary>
        public bool ReadOnly { get; set; }


        public SelectList GetDepartmentList()
        {
            IDepartmentRepository departments = repositoryService.DepartmentRepositoryCreateInstance();
            return new SelectList(departments.GetAll(), "Id", "Name");
        }

        public SelectList GetDiplomProjectTypeList()
        {
            IDiplomProjectTypeRepository types = repositoryService.DiplomProjectTypeRepositoryCreateInstance();
            return new SelectList(types.GetAll(), "Id", "Name");
        }


    }
}